package spring.cloud.tasks.api.domain.task;

public enum TaskType {

    TASK_TYPE_ITEM_TASK, TASK_TYPE_MESSAGE_QUEUE_TASK, TASK_TYPE_BATCH_TASK, UNKNOWN_TASK;

    public static final TaskType getTaskType(String jobType) {
        try {
            return valueOf(jobType);
        } catch (Exception e) {
            return UNKNOWN_TASK;
        }
    }

    public static boolean isCronTaskType(TaskType taskType) {
        return TASK_TYPE_ITEM_TASK == taskType;
    }


}
